<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  <input type="text" v-model="user.username" placeholder="请输入用户名!"><br>
  <input type="button" value="确定" @click="update()">
</div>

<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
  let v= new Vue({
    el:"div",
    data:{
      user:{
        username:"",
      }
    },
    methods:{
        update(){
        axios.post("/update",v.user).then(function (response){
          if (response.data==1){
            alert("进入修改密码!")
            location.href="/pswd.html"
            return;
          }
          alert("该用户名不存在!")
            v.user.username="";
        })
      }
    }
  })
</script>

</body>
</html>